{% extends 'VipBundle:VipAdmin:layout.html.twig' %}

{% block title%}会员操作记录 -{{ parent() }}{% endblock %}

{% block main %}

<div class="page-header clearfix">
  <h1 class="pull-left">会员操作记录</h1>
</div>

 <form id="member-search-form" class="form-inline well well-sm" action="" method="get" novalidate>
    <div class="form-group">
      <select class="form-control" name="boughtType">
        {{ select_options(dict('boughtType'), app.request.query.get('boughtType'), '--按购买类型--') }}
      </select>
    </div>
    <span class="divider"></span>

    <div class="form-group">
      <input type="text" id="keyword" name="nickname" class="form-control" value="{{ app.request.query.get('nickname') }}" placeholder="按用户名">
    </div>
     <button class="btn btn-primary">搜索</button>
</form>
{% if memberHistories %}
     <table id="member-history-table" class="table table-striped table-hover" data-search-form="#member-history-search-form">
      <thead>
        <tr>
          <th>用户名</th>
          <th>操作时间</th>
          <th>到期时间</th>
          <th>操作类型</th>
          <th>会员等级</th>
          <th>开通时长</th>
          <th>支付费用</th>
        </tr>
      </thead>
      <tbody>
        {% for memberHistory in memberHistories %}
          {% set level = levels[memberHistory.levelId]|default('--') %}
          {% set user = users[memberHistory.userId]|default(null) %}
          {% include 'VipBundle:VipAdmin:member-history-table-tr.html.twg' with {memberHistory:memberHistory} %}
        {% endfor %}
      </tbody>
    </table>
{% else %}
    <div class='empty'>暂无数据</div>
{% endif %}
 {{ web_macro.paginator(paginator) }}

{% endblock %}
